home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / ASPWizard.jar / asp / wizard / def / DefPage.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-20  |  1.8 KB  |  52 lines

  1. package asp.wizard.def;
  2.  
  3. import java.util.Enumeration;
  4.  
  5. public class DefPage extends DefCollection {
  6.    public static final int INVALID_ASSET_ID = -1;
  7.    private DefCollection _childPages = new DefCollection();
  8.    private int _assetId = -1;
  9.  
  10.    public void addChildPage(DefPage childPage) {
  11.       this._childPages.addElement(childPage);
  12.       ((DefAbstract)childPage).setParent(this);
  13.    }
  14.  
  15.    public void removeChildPage(DefPage childPage) {
  16.       this._childPages.removeElement(childPage);
  17.    }
  18.  
  19.    public DefCollection getChildPages() {
  20.       return this._childPages;
  21.    }
  22.  
  23.    public void removeAll() {
  24.       ((DefCollection)this).removeAllElements();
  25.       this._childPages.removeAllElements();
  26.    }
  27.  
  28.    public int getDescendantCount() {
  29.       int result = 0;
  30.       DefPage aChildPage = null;
  31.  
  32.       for(Enumeration e = this.getChildPages().getElements(); e.hasMoreElements(); ++result) {
  33.          aChildPage = (DefPage)e.nextElement();
  34.          result += aChildPage.getDescendantCount();
  35.       }
  36.  
  37.       return result;
  38.    }
  39.  
  40.    public String getBaseName() {
  41.       return "Page";
  42.    }
  43.  
  44.    public int getAssetId() {
  45.       return this._assetId;
  46.    }
  47.  
  48.    public void setAssetId(int id) {
  49.       this._assetId = id;
  50.    }
  51. }
  52.